//
//  JWShopMeMyCollectionVC.m
//  jinwang
//
//  Created by jzb on 2018/4/11.
//  Copyright © 2018年 jzb. All rights reserved.
//

#import "JWShopMeMyCollectionVC.h"

@interface JWShopMeMyCollectionVC ()

@property (nonatomic, strong) MLMSegmentHead *segHead;
@property (nonatomic, strong) MLMSegmentScroll *segScroll;

@end

@implementation JWShopMeMyCollectionVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的收藏";
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.f) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    NSArray *list = @[@"商品",@"店铺"];
    _segHead = [[MLMSegmentHead alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 44) titles:list headStyle:SegmentHeadStyleLine layoutStyle:MLMSegmentLayoutDefault];
    //    _segHead.fontScale = 1.1;
    _segHead.fontSize = 16;
    _segHead.deSelectColor = kRGBColor(80, 80, 80);
    _segHead.selectColor = UIColorHex(0xEEA72B);
    _segHead.lineScale = 1;
    _segHead.bottomLineHeight = .5;
    _segHead.lineColor = UIColorHex(0xEEA72B);
    //    _segHead.headColor = [UIColor clearColor];
    _segHead.bottomLineColor = kRGBColor(230, 230, 230);
    
    _segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, 44, kScreenWidth, kScreenHeight - 44-64)  vcOrViews:[self vcArr:list.count]];
    
    _segScroll.loadAll = YES;
    _segScroll.showIndex = 0;
    
    //    _segScroll.backgroundColor = [UIColor purpleColor];
    
    [MLMSegmentManager associateHead:_segHead withScroll:_segScroll completion:^{
        
        [self.view addSubview:_segHead];
        [self.view addSubview:_segScroll];
    }];
}
#pragma mark - 数据源
- (NSArray *)vcArr:(NSInteger)count {
    NSMutableArray *arr = [NSMutableArray array];
    
    UIViewController *Snapshot_VC = [[UIViewController alloc]init];
    UIViewController *Loveshot_VC = [[UIViewController alloc]init];
    
    Snapshot_VC.view.backgroundColor = [UIColor cyanColor];
    Loveshot_VC.view.backgroundColor = [UIColor purpleColor];
    
    [arr addObject:Snapshot_VC];
    [arr addObject:Loveshot_VC];
    
    return arr;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
